package gek.uni.aspirant.ocl.parser.ocl2tree.parser;

import gek.uni.aspirant.ocl.parser.mptree.tree.INode;

import org.eclipse.ocl.ecore.EcoreEnvironmentFactory;
import org.eclipse.ocl.ecore.OCL;
import org.eclipse.ocl.ecore.OCL.Helper;
 
public class OclToMPTreeParser implements IParser<INode> {
  private OCL ocl;
  private Helper helper;
  private String expression;

  public OclToMPTreeParser() {
    ocl = OCL.newInstance(EcoreEnvironmentFactory.INSTANCE);
    helper = ocl.createOCLHelper();
//    helper.setContext(StackPackage.eINSTANCE.getStack());
  }

  @Override
  public INode parse() throws Exception {
//    
//    try {
//      OCLExpression expression2 = helper.createQuery(expression);
//      VariableNameTreeBuilder bldr = new VariableNameTreeBuilder();
//      INode accept = expression2.accept(bldr);
//      return accept.getRoot();
//    } catch (Exception e) {
//      e.printStackTrace();
//    }
    return null;
  }

  @Override
  public void setStringToParse(String string) {
    expression = string;
  }
}
